import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;


@SuppressWarnings("serial")
public class GameFrame extends JFrame {
	
	private InputPanelContainer mInputPanelContainer;
	
	public GameFrame() {
		mInputPanelContainer = new InputPanelContainer(new Dimension(200,600));
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.add(mInputPanelContainer, BorderLayout.EAST);
		mInputPanelContainer.addPanel(new InputPanel(4, "huge schlongs"));
	}
	
	public void changeGameState(GameState gs){
		mInputPanelContainer.clearPanels();
		for (GameState.InputKeyListener ipk : gs.getListeners()){
			mInputPanelContainer.addPanel(new InputPanel(ipk.getKeyCode(), ipk.getCommandDescription()));
			this.addKeyListener(ipk);
		}
	}
}
